<template>
    <Modal v-model="modal" title="删除提示" @on-cancel="canceledit">
        <p>填写的计划将会被清除，需要重新填写！</p>
        <div slot='footer'>
            <Button @click="canceledit">取消</Button>
            <Button @click="submitedit" type="error">删除</Button>
        </div>
    </Modal>
</template>

<script>
    import { netplandelplan } from '@/api/hqapi';
    export default {
        name: 'Delete',
        data () {
            return {
                modal: false,
                params: { id: '' }
            };
        },
        methods: {
            initial (row) {
                this.params.id = row.id
                this.modal = true
            },
            canceledit () {
                this.modal = false
            },
            submitedit () {
                netplandelplan(this.params).then(res => {
                    this.$Message.success('删除成功');
                    this.$emit('askData');
                    this.modal = false
                })
            }
        }
    };
</script>

<style lang="scss" scoped>

</style>
